package com.qzsoft.system.modules.permission.group.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.qzsoft.jeemis.common.validator.group.DefaultGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.validation.constraints.NotBlank;

/**
 * 菜单信息表(ServiceMenu)表实体类
 *
 * @author zt
 * @since 2020-08-28 09:48:04
 */
@ApiModel(value = "菜单信息表")
@Data
@EqualsAndHashCode(callSuper = false)
@NoArgsConstructor
@AllArgsConstructor
@Builder
@ToString
@TableName("sys_group")
public class SysGroupEntity extends Model<SysGroupEntity> {
    private static final long serialVersionUID = -45626516681731840L;

    /**
     * id主键
     */
    @TableId(type = IdType.ASSIGN_ID) //主键ASSIGN_ID策略
    @ApiModelProperty(value = "id主键")
    // @NotBlank(message = "{id.require}", groups = UpdateGroup.class)
    private String id;


    /**
     *  上级ID
     */
    @ApiModelProperty(value = "上级菜单 上级ID")
    private String pid;
    /**
     * 用户组code
     */
    @ApiModelProperty(value = "用户组code")
    @NotBlank(message = "用户组编码不能为空", groups = DefaultGroup.class)
    private String code;

    /**
     * 用户组名称
     */
    @ApiModelProperty(value = "用户组名称")
    @NotBlank(message = "用户组名称", groups = DefaultGroup.class)
    private String name;


    /**
     * 叶子节点 0:是 1:否 默认：0
     */
    @ApiModelProperty(value = "叶子节: 1:是 默认：0")
    private Integer hasLeaf;

    /**
     * 排序
     */
    @ApiModelProperty(value = "排序")
    private Integer orderId;

    /**
     * 0:存在 1:删除 默认：0
     */
    @ApiModelProperty(value = "0:存在 1:删除 默认：0")
    private Integer hasDelete;

    /**
     * 备注
     */
    @ApiModelProperty(value = "备注")
    private String remark;


//    @ApiModelProperty(value = "默认角色名称")
//    @TableField(exist = false)
//    private String roleId;
//    @ApiModelProperty(value = "角色名称")
//    @TableField(exist = false)
//    private String roleName;
}
